<template>
  <div class="newest">
    <div class="title">
      <span class="iconfont icon-dingwei"></span>
      <span class="title1" @click="fun('one')" :class="lei1">最新内容</span>
      |
      <span class="title2" @click="fun('two')" :class="lei2">最热攻略</span>
      <span class="more">更多&nbsp;&gt;</span>
    </div>

    <div class="once" v-for="(v,i) in newdata" :key="i">
      <img :src="v.imgsrc" alt="" class="post">
      <div class="zi">
        <div class="biaoti">{{v.biaoti}}</div>
        <div class="author">
          <div class="touxiang">
            <img :src="v.touxiangImg" alt="">
            <span class="name">{{v.name}}</span>
          </div>
          <span class="time">{{v.time}}</span>
        </div>
      </div>
    </div>

  </div>
</template>

<script>
export default {
  data(){
    return{
      lei1:'actived',
      lei2:''
    }
  },
  methods: {
    fun(data){
      this.lei1 = '';
      this.lei2 = '';
      if(data == 'one'){
        this.lei1 = 'actived';
      }
      if(data == 'two'){
        this.lei2 = 'actived';
      }
    }
  },
  created(){
    this.$store.dispatch('getnewest',{url:"/data/gongLue/newest"})
  },
  computed:{
    newdata(){
      return this.$store.state.newest.data;
    }
  },
}
</script>

<style scoped>
  .newest{
    min-height: 2.12rem;
    /* background-color: tomato; */
  }
  .newest .title{
    height: .43rem;
    /* background-color: thistle; */
  }
  .newest .title{
    line-height: .43rem;
    font-size: .18rem;
  }
  .icon-dingwei{
    font-size: .2rem;
    vertical-align: middle;
  }
  .newest .title .title1{
    margin: 0 .05rem;
    vertical-align: middle;
    color: rgb(155,155,155);
  }
  .newest .title .title2{
    margin-left: .05rem;
    vertical-align: middle;
    color: rgb(155,155,155);
  }
  .newest .title .more{
    vertical-align: middle;
    margin-left: 1.1rem;
    font-size: .12rem;
    color: rgb(165,145,145);
  }
  .newest .title .actived{
    color: black;
  }
  .newest .once{
    height: .9rem;
    /* background-color: brown; */
    padding: .12rem 0;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgb(235,235,235);
  }
  .newest .once .post{
    width: 1.16rem;
    height: 100%;
    border-radius: .05rem;
    background-color: chartreuse;
  }
  .newest .once .zi{
    width: 2.1rem;
    height: 100%;
    /* background-color: darkorange; */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  .newest .once .zi .biaoti{
    font-size: .14rem;
  }
  .newest .once .zi .author{
    height: .2rem;
    /* background-color: darksalmon; */
    display: flex;
    justify-content: space-between;
  }
  .newest .once .zi .author .touxiang img{
    width: .2rem;
    height: .2rem;
    border-radius: 50%;
    vertical-align: middle;
    background-color: darkturquoise;
  }
  .newest .once .zi .author .touxiang .name{
    font-size: .12rem;
    color: rgb(155,155,155);
    vertical-align: middle;
    margin-left: .04rem;
  }
  .newest .once .zi .author .time{
    color: rgb(155,155,155);
    font-size: .12rem;
    line-height: .2rem;
  }
</style>